<!--
  @author heguanghua
  @since 2020/04/24 18:57
-->
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head th:include="common/common::jscss"/>
<body>

<div class="layui-fluid"
     th:with="hasList=${#authPermit.checkPermit('/dept/list.action')},
     hasOrganizeDetail=${#authPermit.checkPermit('/organize/detail.action')},
     hasAddEdit=${#authPermit.checkPermit('/dept/modify/addEdit.action')},
     hasEdit=${#authPermit.checkPermit('/dept/modify/edit.action')},
     hasModifyStatus=${#authPermit.checkPermit('/dept/modify/modifyStatus.action')}">

    <blockquote class="layui-crumb">
        <a th:lay-href="|${SYS_MCC}/organize/tree.action|" lay-text="组织架构">组织架构管理</a>&nbsp;&nbsp;>&nbsp;
        <a th:lay-href="|${SYS_MCC}/organize/detail.action?orgId=${organize.orgId}|" th:lay-text="组织信息" th:text="${organize.orgName}">组织信息</a>&nbsp;&nbsp;>
        <a th:lay-href="|${SYS_MCC}/dept/tree.action?orgId=${organize.orgId}|" th:lay-text="部门管理">部门管理</a>
    </blockquote>

    <div class="layui-card">

        <div class="layui-tab layui-tab-brief">
            <ul class="layui-tab-title">
                <li th:if="${hasOrganizeDetail}"><a th:lay-href="|${SYS_MCC}/organize/detail.action?orgId=${organize.orgId}|" lay-text="组织信息">组织信息</a></li>
                <li class="layui-this"><a th:lay-href="|${SYS_MCC}/dept/tree.action?orgId=${organize.orgId}|" lay-text="部门架构">部门架构</a></li>
            </ul>
        </div>

        <div class="layui-split">&nbsp;</div>

        <form method="post" class="layui-form" lay-filter="zmn-form-filter"  action="/dept/tree.action">
            <div class="layui-form" th:include="dept/_query :: query "></div>
        </form>

        <div class="layui-card-body">

            <div class="layui-btn-container">
                <div class="layui-btn-group" th:if="${hasModifyStatus}">
                    <button class="layui-btn layui-btn-sm" onclick="setStatus(2);">启用</button>
                    <button class="layui-btn layui-btn-sm" onclick="setStatus(1);">停用</button>
                </div>
                <div class="layui-btn-group" th:if="${hasAddEdit}">
                    <a th:lay-href="|${SYS_MCC}/dept/detail.action?orgId=${organize.orgId}|" class="layui-btn layui-btn-sm layui-btn-primary" lay-text="部门信息" th:if="${hasAddEdit}">+新增部门</a>
                </div>
            </div>

            <table class="layui-hide" id="zmn-table" lay-filter="zmn-table"></table>

        </div>

    </div>

</div>
</body>
</html>

<script type="text/javascript" th:inline="javascript">

    var json = {
        orgId: [[${organize.orgId}]],
        hasDetail: [[${#authPermit.checkPermit('/dept/detail.action')}]],
        hasAddEdit: [[${#authPermit.checkPermit('/dept/modify/addEdit.action')}]],
        hasModifySort: [[${#authPermit.checkPermit('/dept/modify/modifySort.action')}]],
        hasBindBeisen: [[${#authPermit.checkPermit('/dept/modify/bindBeisen.action')}]],
        vo: [[${vo}]]
    };

    layui.extend({
        dept_tree: "dept/zmn.dept.tree"
    }).use(['index', 'dept_tree']);

</script>
